import { _decorator, Component, ParticleSystem2D } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('ResetParticle2D')
export class ResetParticle2D extends Component {
  @property([ParticleSystem2D])
  particles: ParticleSystem2D[] = [];

  protected onDisable(): void {
    this.particles.forEach((p) => {
      if (p && p.resetSystem) p.resetSystem();
    });
  }
}
